package com.example.day19_7_19_1.base;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

public abstract class BaseActivity<P extends BasePresenter> extends AppCompatActivity implements BaseView {

    public P iPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayout());
        iPresenter =getPresenter();
        if (iPresenter != null){
            iPresenter.bindView(this);
        }
        initView();
        initData();
    }

    protected abstract P getPresenter();

    protected abstract void initData();

    protected abstract int getLayout();

    protected abstract void initView();
}
